--
-- Author:      name
-- DateTime:    2018-03-31 11:16:41
-- Description: 游戏场次桌子管理
-- 因为可能存在多个gate,game节点所在把这个分配桌子的功能放到global里

require "skynet.manager"
local skynet = require "skynet"
local Objects = require "Objects"
local Message = require "tablestate.Message"
local Command = require "tablestate.Command"

g_objects = Objects.new()

local function init()

	local message = Message.new()
	g_objects:add(message)
	local command = Command.new(message)
	g_objects:add(command)
	g_objects:hotfix("tablestate")

	skynet.dispatch("lua", message:dispatch())
end


skynet.start(function()
	init()
	skynet.register "tablestate"
end)
